Skip to content

ReactiveInjectableComponentBase class

Defined in

Namespace: ReactiveUI.Blazor Assembly: ReactiveUI.Blazor.dll Full name: ReactiveUI.Blazor.ReactiveInjectableComponentBase<T> Modifiers: public

Summary

        A base component for handling property changes and updating the Blazor view appropriately.
        

Applies to

net10.0, net10.0-browserwasm1.0, net10.0-desktop1.0, net9.0, net9.0-browserwasm1.0, net9.0-desktop1.0, net8.0, net8.0-ios17.5, net8.0-maccatalyst17.5, net8.0-macos14.2, net8.0-macos14.5, net8.0-tvos17.2, netstandard2.1

Class hierarchy
classDiagram
class ReactiveInjectableComponentBase~T~
class ComponentBase
ComponentBase <|-- ReactiveInjectableComponentBase~T~
class IViewFor~T~ {
    <>
}
IViewFor~T~ <|.. ReactiveInjectableComponentBase~T~
class IViewFor {
    <>
}
IViewFor <|.. ReactiveInjectableComponentBase~T~
class IActivatableView {
    <>
}
IActivatableView <|.. ReactiveInjectableComponentBase~T~
class INotifyPropertyChanged {
    <>
}
INotifyPropertyChanged <|.. ReactiveInjectableComponentBase~T~
class ICanActivate {
    <>
}
ICanActivate <|.. ReactiveInjectableComponentBase~T~
class IDisposable {
    <>
}
IDisposable <|.. ReactiveInjectableComponentBase~T~

Inherits from: ComponentBase

Implements: IViewFor, IViewFor, IActivatableView, INotifyPropertyChanged, ICanActivate, IDisposable

Remarks

This component triggers StateHasChanged when either the view model instance changes or the current view model raises PropertyChanged.

Trimming/AOT: this type avoids expression-tree-based ReactiveUI helpers (e.g. WhenAnyValue) and uses event-based observables instead.

The ViewModel is provided via DI using InjectAttribute.

Constructors

NameSummary
.ctor

Properties

NameSummary
ViewModelGets or sets the strongly typed view model. Override this property to integrate with the platform's binding system.
ActivatedGets a observable which is triggered when the ViewModel is activated.
DeactivatedGets a observable which is triggered when the ViewModel is deactivated.

Methods

NameSummary
DisposeDisposes the component and releases managed resources.
OnInitializedMethod invoked when the component is ready to start, having received its initial parameters from its parent in the render tree.
OnAfterRenderMethod invoked after each time the component has rendered interactively and the UI has finished updating (for example, after elements have been added to the browser DOM). Any...
OnPropertyChangedInvokes the property changed event.

Events

NameSummary
PropertyChanged
Inherited members